import request from '@/utils/request'

export default {

    //得到所有的讲师
    getAllTeachers() {
        //需要return 才阔以，返回一个promise对象
        return request({
            url: '/eduservice/edu-teacher/findAll',
            method: 'get'
        })
    },
    //添加课程
    addCourseInfo(courseInfo) {
        return request({
            url: '/eduservice/course/addCourse',
            method: 'post',
            data: courseInfo
        })
    },

    //根据id获取课程信息，上一步，进行信息回显
    getCourseInfo(courseId) {
        return request({

            url: '/eduservice/course/getCourseInfo/' + courseId,
            method: 'get',
            // data: courseId

        })
    },

    //更新课程信息
    updateCourseInfo(courseInfoVo) {
        return request({

            url: '/eduservice/course/updateCourseInfo',
            method: 'put',
            data: courseInfoVo

        })

    },

    //课程确认信息显示
    getPublishCourseInfo(id) {
        return request({

            url: '/eduservice/course/getCoursePublishInfo/' + id,
            method: 'get'
        })
    },
    //课程最终发布
    publishCourse(id) {
        return request({
            url: '/eduservice/course/publishCourse/' + id,
            method: 'post'
        })
    },

    //列表相关，分页查询
    pageList(current, limit) {
        return request({
            url: `/eduservice/course/pageList/${current}/${limit}`,
            method: 'get'
        })
    },
    //条件查询
    pageCondition(current, limit, eduCourse) {
        return request({
            url: `/eduservice/course/pageCondition/${current}/${limit}`,
            method: 'post',
            data: eduCourse

        })
    },

    //删除课程
    removeCourse(courseId) {
        return request({
            url: `/eduservice/course/removeCourse/${courseId}`,
            method: 'delete'
        })

    }

}
